//
//  ByCellScoreStoreDetailTransfer.m
//  mijifen_ios
//
//  Created by 朱凯 on 2017/11/8.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByCellScoreStoreDetailTransfer.h"

@implementation ByCellScoreStoreDetailTransfer
{
    UIView      *_bgView;
    UILabel     *_titleLabel;
    UILabel     *_scoreLabel;
    UILabel     *_noteLabel;
    UIButton    *_funcButton;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSeparatorStyleNone;
        self.backgroundColor = [UIColor clearColor];
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    
    _bgView = [UIView new];
    _bgView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:_bgView];
    
    
    _titleLabel = [[UILabel alloc] init];
    _titleLabel.backgroundColor = BY_GOLD_COLOR;
    _titleLabel.text = @"当前拥有 天阳电器 积分";
    _titleLabel.font = FONT(18);
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = [UIColor whiteColor];
    [_bgView addSubview:_titleLabel];
    
    _scoreLabel = [[UILabel alloc] init];
    _scoreLabel.text = @"220000";
    _scoreLabel.font = FONT(25);
    _scoreLabel.textAlignment = NSTextAlignmentCenter;
    _scoreLabel.textColor = BY_GOLD_COLOR;
    [_bgView addSubview:_scoreLabel];
    
    _noteLabel = [[UILabel alloc] init];
    _noteLabel.text = @"注：您的积分数据，平台将在第二天午时之前更新";
    _noteLabel.font = FONT(14);
    _noteLabel.textAlignment = NSTextAlignmentCenter;
    _noteLabel.textColor = [UIColor blackColor];
    [_bgView addSubview:_noteLabel];
    
    _funcButton = [UIButton buttonWithType:UIButtonTypeCustom];
    _funcButton.titleLabel.font = FONT(14);
    [_funcButton setBackgroundImage:[UIImage imageWithColor:BY_THEME_COLOR] forState:UIControlStateNormal];
    [_funcButton setBackgroundImage:[UIImage imageWithColor:BY_LINE_COLOR] forState:UIControlStateDisabled];
    [_funcButton setTitle:@"转换蜜积分" forState:UIControlStateNormal];
    [_funcButton setTitle:@"不可转换" forState:UIControlStateDisabled];
    [_funcButton setTitleColor:BY_GOLD_COLOR forState:UIControlStateNormal];
    [_funcButton setTitleColor:[UIColor whiteColor] forState:UIControlStateDisabled];
    [_bgView addSubview:_funcButton];
    
    
    
    [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.top.equalTo(@0);
        make.right.equalTo(@-10);
    }];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.equalTo(@0);
        make.height.equalTo(@40);
    }];
    [_scoreLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.equalTo(@0);
        make.top.equalTo(_titleLabel.mas_bottom);
        make.height.equalTo(@60);
    }];
    [_noteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@10);
        make.right.equalTo(@-10);
        make.top.equalTo(_scoreLabel.mas_bottom);
    }];
    [_funcButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_noteLabel.mas_bottom).offset(20);
        make.height.equalTo(@35);
        make.width.equalTo(@120);
        make.right.equalTo(@0);
        make.bottom.equalTo(_bgView);
    }];
    [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.contentView);
    }];

}

@end
